<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/16
 * Time: 11:16
 */

namespace app\common\model;

class IssuesModel extends \think\Model
{
    protected $table = "we_issues";
    protected $autoWriteTimestamp = true;

    protected static function init()
    {
        parent::beforeInsert(function ($user) {
            if (empty($user->openId)) {
                return false;
            }
            if (empty($user->title)) {
                return false;
            }
            if (empty($user->content)) {
                return false;
            }
        }, true);
    }
}